home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12239 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Determining the length of an int in string form
  5. Date: Fri, 29 Mar 96 23:15:52 GMT
  6. Organization: none
  7. Message-ID: <828141352snz@genesis.demon.co.uk>
  8. References: <3156D7BD.90D@oc.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <3156D7BD.90D@oc.com> lfw@oc.com "Larry Weiss" writes:
  15.  
  16. >Lawrence Kirby wrote:
  17. > > 
  18. > > In article <3155E067.3261@iadfw.net> lfw@iadfw.net "Larry Weiss" writes:
  19. > > >Now what I'd really like to see in the next revision of the standard
  20. > library
  21. > > >would be an snprintf() with the extra argument to declare only so many
  22. > > >writeable chars in the buffer, and a return code to indicate logical
  23. > > >attempts to write beyond that limit.
  24. > > 
  25. > > Indeed, a return value indicating how many characters would have been
  26. > > written to the buffer if it were large enough.
  27. > > 
  28. >
  29. >That would be great!  That way you could specify zero chars available
  30. >if you just wanted to learn how many to allocate ideally for the real event.
  31.  
  32. Or have a buffer you used for many calls to snprintf and which you could
  33. dynamically extend when it was too small.
  34.  
  35. >Do implementations of snprintf() exist today that could be held up
  36. >as prior-art?
  37.  
  38. I don't know of any offhand.
  39.  
  40. -- 
  41. -----------------------------------------
  42. Lawrence Kirby | fred@genesis.demon.co.uk
  43. Wilts, England | 70734.126@compuserve.com
  44. -----------------------------------------
  45.